<?php

namespace Xrfg\Core\Trading\Account\Models;

/**
 * Trait AccountLogHelper.
 *
 * @property float|null $available 可用余额
 * @property float|null $disabled  冻结余额
 */
trait ContractAccountLogHelper
{
    public $availableChange;

    public $disabledChange;

    public $event;

    public $summary;

    public static function boot()
    {
        parent::boot();
    }

    public function availableIncrement($number)
    {
        $this->available = bcadd($this->available, $number);
        $this->availableChange = +$number;
    }

    public function availableDecrement($number)
    {
        $this->available = bcsub($this->available, $number);
        $this->availableChange = -$number;
    }

    public function disabledIncrement($number)
    {
        $this->disabled = bcadd($this->disabled, $number);
        $this->disabledChange = +$number;
    }

    public function disabledDecrement($number)
    {
        $this->disabled = bcsub($this->disabled, $number);
        $this->disabledChange = -$number;
    }
}
